<?php $__env->startSection('title','业绩分分类汇总'); ?>
<?php $__env->startSection('css'); ?>
<link href="<?php echo e(asset(getThemeAssets('css/toastr.min.css'))); ?>" rel="stylesheet">
<link href="https://cdn.bootcss.com/bootstrap-table/1.11.1/bootstrap-table.min.css" rel="stylesheet">
<style type="text/css">
    .widget .row span{
      font-size: 15px;
      font-weight: bold;
    }
    .p-md{
        padding-top: 6px;
        padding-bottom: 0px;
        margin-top: 0px;
        margin-bottom: 30px;
    }
    .m-b-md{
        padding-top: 3px;
    }
    .page-heading{
        padding-bottom: 2px;
    }
    .alert{
        /*padding-bottom: 0px;*/
        padding-left: 23px;
        padding-right: 23px;
        margin-bottom: 0px;
    }
    .alert p{
        font-size: 14px;
        font-weight: 12px;
    }
    .alert a{
        text-decoration: underline;
    }
    .canceled{
        margin: 0;
        padding: 0;
    }
    #login-form {
        margin-top: 30px;
        margin-left: 0px;
        margin-right: 0px;
    }
    #login-form img{
        width: 100%;
        margin-left: 0;
    }
    #footerrow {
      margin-top: 100px;
    }
    .col-sm-6 {
      padding: 3px;
    }
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>

<div class="row wrapper border-bottom page-heading">
  <div class="col-sm-4">
    <h2><?php echo trans('performancescore.title'); ?></h2>
    <ol class="breadcrumb">
        <li>
            <a href="<?php echo e(url('admin')); ?>"><?php echo trans('home.title'); ?></a>
        </li>
        <li class="active">
            <strong><?php echo trans('performancescore.subTitle'); ?></strong>
        </li>
    </ol>
  </div>
</div>
<div id="login-form">
    <div class="logo">
        <img id="logo" src="<?php echo e(asset(getThemeAssets('img/logo2.png'))); ?>">
    </div>
    <div class="row">
    <div class="col-sm-10 col-sm-offset-1 col-lg-10 col-lg-offset-1">
      <table class="table table-bordered" id="tableActivity" data-toggle="table" style="width:100%">

      </table>
    </div>
  </div>
</div>
                        

<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<script src="<?php echo e(asset(getThemeAssets('js/toastr.min.js'))); ?>"></script>
<script src="<?php echo e(asset(getThemeAssets('dataTables/datatables.min.js', true))); ?>"></script>
<script src="<?php echo e(asset(getThemeAssets('dataTables/vfs_fonts.js', true))); ?>"></script>
<script src="<?php echo e(asset(getThemeAssets('dataTables/buttons.colVis.min.js', true))); ?>"></script>
<script src="<?php echo e(asset(getThemeAssets('dataTables/pdfmake.min.js', true))); ?>"></script>
 <script src="https://cdn.bootcss.com/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>
<script type="text/javascript">
    $(function () {
      var datatables = $('#datatables').DataTable({
        dom: 'Brtip',
        buttons: [
          {extend: 'colvis', text: '选择列'},
          {extend: 'csv', text: '导出csv文件'},
          {extend: 'excel', text: '导出excel文件'},
          {extend: 'pdf', text: '导出pdf文件'}
        ],   
        ordering: true,
        processing: true,
        serverSide: true,
        deferRender: true,
        pageLength: 10,
        ajax: "<?php echo e(url('/admin/construction/awarddata')); ?>",
        columns: [
          {
            searchable: true,
            data: 'id',
            width: 150
          },
          {
            searchable: false,
            data: 'project_id',
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'project_name',
            width: 200,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'jobnumber',
            width: 180,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'charge_name',
            width: 200,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'department_name',
            width: 200,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'create_year',
            width: 200,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'category',
            width: 200,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'level',
            width: 200,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'archive_number',
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'hasfinished',
            render: function (data, type, row) {
              if (data == '1') {
                return '是';
              } else {
                return '否';
              }
            }
          },
          {
            searchable: false,
            data: null,
            width: 100,
            render: function (data, type, row) {
                return '<a href="/' + row.id + '" class="btn btn-xs btn-info"><i class="fa fa-eye"></i></a> <a href="<?php echo e(url('/admin/construction/edit')); ?>/' + row.id + '" class="btn btn-xs btn-warning"><i class="fa fa-edit"></i></a> <a href="<?php echo e(url('/admin/construction/destroy')); ?>/' + row.id + '" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i></a>';
            }
          }
        ],
        initComplete: function () {
          this.api().columns([1]).every(function () {
            var column = this;
            var input = document.createElement('input');
            $(input).appendTo($(column.footer()).empty()).on('change', function () {
              column.search($(this).val(), false, false, true).draw();
            });
          });
        }
      });

      

    });

    $('#tableActivity').bootstrapTable('destroy').bootstrapTable({
            url:'',
            detailView:true,
            detailFormatter:"detailFormatter",//点击展开预先执行事件
            cache: false,
            height: 550,
            showExport: true,
            exportDataType: "all",    
            pagination: true,
            pageSize: 10,
            pageList: [10, 25, 50, 100],
            search: true,
            searchAlign:'left',
            showRefresh: true,
            showToggle: true,
            showColumns: true,
            toolbarAlign: 'right',
            toolbar:"#toolbar",
            buttonsAlign:'left',
            clickToSelect: true,
            idField:'',
            columns: [
                      [
                          {
                              title: '部门',
                              field: 'userName',
                              rowspan: 2,
                              align: 'center',
                              valign: 'middle',
                              sortable: true

                          }, {
                              title: '质量建设与评估办公室',
                              colspan: 4,
                              align: 'center'
                          }, {
                              title: '实践教学科',
                              colspan: 7,
                              align: 'center'
                          }, {
                              title: '教务科',
                              colspan: 2,
                              align: 'center'
                          }, {
                              title: '实验室管理与设备科',
                              colspan: 1,
                              align: 'center'
                          }, {
                              title: '小计',
                              colspan: 1,
                              rowspan: 2,
                              align: 'center',
                              valign: 'middle',
                              align: 'center'
                          }
                      ],
                      [
                          {
                              field: 'handoutCount',
                              title: '专业建设',
                              sortable: true,
                              align: 'center'
                          }, {
                              field: 'handoutComCount',
                              title: '课程建设',
                              sortable: true,
                              align: 'center'

                          }, {
                              field: 'handoutCountDegree',
                              title: '教改建设',
                              sortable: true,
                              align: 'center'


                          }, {
                              field: 'videoCount',
                              title: '教研建设',
                              sortable: true,
                              align: 'center'


                          }, {
                              field: 'videoComCount',
                              title: '大学生创新实践基地管理业绩分',
                              sortable: true,
                              align: 'center'


                          }, {
                              field: 'videoCountDegree',
                              title: '学生竞赛获奖教师指导业绩分',
                              sortable: true,
                              align: 'center'


                          }, {
                              field: 'allCount',
                              title: '竞赛承办业绩分',
                              sortable: true,
                              align: 'center'


                          }, {
                              field: 'allComCount',
                              title: '社团联合会指导',
                              sortable: true,
                              align: 'center'


                          }, {
                              field: 'allDegree',
                              title: '本科生创新计划',
                              sortable: true,
                              align: 'center'
                          }, {
                              field: 'allDegree',
                              title: '省、校优秀毕业设计奖励',
                              sortable: true,
                              align: 'center'
                          }, {
                              field: 'allDegree',
                              title: '教务团工第二课堂组织工作量',
                              sortable: true,
                              align: 'center'
                          }, {
                              field: 'allDegree',
                              title: '理论培训',
                              sortable: true,
                              align: 'center'
                          }, {
                              field: 'allDegree',
                              title: '上机培训',
                              sortable: true,
                              align: 'center'
                          }, {
                              field: 'allDegree',
                              title: '实验室与设备管理业绩分',
                              sortable: true,
                              align: 'center'
                          }
                      ], [
                          {
                              field: 'jiaoxue',
                              title: '教学单位',
                              align: 'center',
                              valign: 'middle',
                          },
                      ],
                      [
                          {
                              field: 'xingzheng',
                              title: '行政部门',
                              align: 'center',
                              valign: 'middle',
                          },
                      ]

                  ]

        });

      function detailFormatter(index, row) {
                handoutColums=[];
                handoutData=[];
                videoColums=[];
                videoData=[];
                var html = [];
                html.push('<div  class="row">');
                html.push('<div class="col-md-6">');
                html.push('<table id="tableHandout'+index+'"></table>');
                html.push('</div>');
                html.push('<div class="col-md-6">');
                html.push('<table id="tableVideo'+index+'"></table>');
                html.push('</div>');
                html.push('</div>');
                handoutColums.push({
                    field: 'handoutIndex',title: '编号', sortable: true ,width: 150
                },{
                    field: 'handoutName',title: '讲义名称', sortable: true ,width: 150
                },{
                    field: 'degree',title: '完成度', sortable: true ,width: 150
                });
                videoColums.push({
                    field: 'videoIndex',title: '编号', sortable: true ,width: 150
                },{
                    field: 'videoName',title: '视频名称', sortable: true ,width: 150
                },{
                    field: 'degree',title: '完成度', sortable: true ,width: 150
                });
                $.each(row, function (key, value) {
                    if(key=="handout"){
                    $.each(value,function(index,handout){
                        var row = {};
                        row['handoutIndex'] = index+1;
                        row['handoutName']=handout.handoutName;
                        row['degree']=handout.degree;
                        handoutData.push(row);

                    });
                    }
                    if(key=="video"){
                    $.each(value,function(index,video){
                        var row = {};
                        row['videoIndex']=index+1;
                        row['videoName']=video.videoName;
                        row['degree']=video.degree;
                        videoData.push(row);
                    });
                    }
                });

                return html.join('');
            }

         $('#tableActivity').on('expand-row.bs.table', function (e, index, row, $detail) {
              initHandoutTable(handoutColums,handoutData,index);
              initVideoTable(videoColums,videoData,index);
            }); 

          function initHandoutTable(colums,data,index){
              $('#tableHandout'+index).bootstrapTable('destroy').bootstrapTable({
                    cache: false,
                    height: 200,
                    clickToSelect: true,
                    idField:'',
                    columns:colums,
                    data:data
                });
            }

          function initVideoTable(colums,data,index){
                $('#tableVideo'+index).bootstrapTable('destroy').bootstrapTable({
                    cache: false,
                    height: 200,
                    clickToSelect: true,
                    idField:'',
                    columns:colums,
                    data:data
                });
          }
    


</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.'.getTheme(), array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>